<template>
  <view class="" @click="handleClick">
    <slot></slot>
  </view>
</template>

<script>
export default {
  name: "",
  props: {
    list: {
      type: Array,
      default() {
        return [];
      },
    },
    index: {
      type: Number,
    },
  },
  components: {},
  data() {
    return {};
  },
  mounted() {
    // console.log(this.list);
    //console.log(this.index);
  },
  methods: {
    handleClick() {
      //将数据缓存下来
      console.log("点击事件");
      var app = getApp();

      app.globalData.imgList = this.list;
      app.globalData.imgIndex = this.index;
      uni.navigateTo({
        url: "/pages/home/imgDetail",
      });
    },
  },
};
</script>
<style scoped></style>
